package com.finfosoft.filter;

import org.apache.catalina.filters.RemoteIpFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class WebConfiguaration {

	@Bean
	public RemoteIpFilter remoteIpFilter(){
		
		return new RemoteIpFilter();
	}
	
	@Bean
	public FilterRegistrationBean getFilterRegistrationBean(){
		
		FilterRegistrationBean bean = new FilterRegistrationBean();
		bean.setFilter(new MyFilter());
		bean.addUrlPatterns("/*");
		bean.addInitParameter("paramName", "paramValue");
		bean.setName("MyFilter");
		bean.setOrder(1);
		return bean;
	}
	
	
	
	
}
